home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 18 / CU Amiga Magazine's Super CD-ROM 18 (1997)(EMAP Images)(GB)[!][issue 1998-01].iso / CUCD / Online / hsc / docs-source / others.hsc < prev    next >
Encoding:
Text File  |  1997-11-02  |  5.0 KB  |  137 lines

  1. <WEBPAGE chapter="hsc - " title="Using Other html-Extensions"
  2.     PREV="ports.html"
  3.     NEXT="bugs.html">
  4.  
  5. <P>As html has turned out to be incredibly useless very soon, many
  6. people have written several extension trying to reduce this
  7. uselessness. Most of them only increased it. However, this will
  8. shortly comment on some of these extensions, and how you can use them
  9. together with <hsc>.</P>
  10.  
  11. <H2>General Comments</H2>
  12.  
  13. <P>When you process a page with <hsc>, there is no way to change any
  14. data of the html-object after it has been created; <hsc> only does a
  15. static job. Many of the extensions described below allow documents or
  16. parts of them being created dynamically. But then you will have to
  17. care about several security problems.</P>
  18.  
  19. <P>Most of these concepts integrate themselves into html in a quite
  20. clean way (usually by means of sgml-comments). For others you will
  21. need to utilise <ln-skip-verbatim> to make <hsc> accept them. If this
  22. still does not help, there is no way to use a specific extension
  23. together with <hsc>. There definitely will not be built-in support for
  24. any of these extensions.</P>
  25.  
  26. <P>This chapter does not pretend to describe all of them, but most
  27. suggestions provided here should also work with most others
  28. extensions. You also will not find any information about where to
  29. obtain these tools from. Ask your favourite w3-search engine for
  30. details.</P>
  31.  
  32. <H2>Server Side Includes</H2>
  33.  
  34. <P>Server Side Includes (ssi) are one of the oldest extensions for
  35. w3-servers. An example command would be
  36.  
  37. <$source PRE><!--#echo="DATE_GMT"--></$source>
  38.  
  39. which more or less does the same as
  40.  
  41. <$source PRE><(GetGMTime())></$source>
  42.  
  43. <P>in <hsc>, with the difference that the ssi-version will be executed
  44. every time one accesses the page.</P>
  45.  
  46. <P>As the ssi-call is done inside a sgml-comment, <hsc> will
  47. not care about it and simply skip it. Only make sure you did not set
  48. the command line option <op_stripcomment>. The sgml-comment later will
  49. be substituted by your server (if it supports ssi).</P>
  50.  
  51. <P>Usually ssi-operations result in an increased CPU-load of your
  52. server, as they have to be performed every time one accesses the page.
  53. </P>
  54.  
  55. <H2>Common Gateway Interface</H2>
  56.  
  57. <P>Most w3-servers also support the so called Common Gateway Interface
  58. (cgi). This is just the simple capability to return the output a
  59. program wrote to <stdout> as w3-page. Cgi-programs are usually
  60. unreadable and unmaintainable Perl-scripts more or less entirely
  61. consisting of statements like
  62. <CODE><$source>printf("<HTML><HEAD><TITLE>cool
  63. script</TITLE>..")</$source></CODE>.</P>
  64.  
  65. <P>Ill-minded people could think about invoking <hsc> inside a
  66. cgi-script. I do not recommend this because of several reasons that
  67. should be obvious.</P>
  68.  
  69. <H2>JavaScript</H2>
  70.  
  71. <P>JavaScript has been developed to show scrolling messages on your
  72. pages. It should have been named ScrollerScript, but as it came out
  73. more or less the same time when the hype on a programming language
  74. called Java (poor man's SmallTalk raped by C++ which is expected to
  75. solve all problems of the world, including traffic, pollution and
  76. AIDS) started, it's creators decided to use the term <qq>Java</qq> in
  77. it's name, too.</P>
  78.  
  79. Scripts implemented in a clean way like
  80.  
  81. <$source PRE><script type="text/javascript"><!--
  82. // ..script text..
  83. // -->
  84. </script></$source>
  85.  
  86. should not cause problems, as they are also embedded inside
  87. sgml-comments like ssi.
  88.  
  89. <H2>Personal Home Page Tool/Form Interpreter</H2>
  90.  
  91. <P>The Personal Home Page Tool/Form Interpreter (php/fi) started as a
  92. messy Perl-script acting as some simple cgi-wrapper. While time was
  93. passing, it grew to a inflated and inconsistent moloch providing a
  94. simple programming language inside html-documents. It also supports
  95. things like Embedded SQL, and some people with other presuicidal
  96. syndromes even use it as a plug-in with their w3-server.</P>
  97.  
  98. <P>The syntax does a very good job on combining the drawbacks of C
  99. with the disadvantages of Perl, in general resulting in a completely
  100. unreadable sequence of seemingly random characters. Therefor it became
  101. quite popular among Unix-fossils. For example, one could have this
  102. line in a source code:</P>
  103.  
  104. <$source PRE><?echo "Hi $Name!<P>"></$source>
  105.  
  106. If you pass this to <hsc>, it will not be very happy about it.
  107. However, you can use <ln-skip-verbatim> to include php/fi-stuff:
  108.  
  109. <$source PRE><|<?echo "Hi $Name!<P>">|></$source>
  110.  
  111. If you want to access data of <hsc> into your php/fi-section, it will
  112. become a bit tricky. But with <ln-insert-expression> even this is
  113. possible:
  114.  
  115. <$source PRE>
  116. <$define Name:string="Sepp">
  117. <(
  118.    '<|'                             +
  119.    '<?echo "Hello, ' + Name + '!">' +
  120.    '|>'
  121. )></$source>
  122.  
  123. will temporary result in
  124.  
  125. <$source PRE><|<?echo "Hello, Sepp!">|></$source>
  126.  
  127. and after being processed by <hsc> a
  128.  
  129. <$source PRE><?echo "Hello, Sepp!"></$source>
  130.  
  131. <P>will show up in the html-object. If you are really sure that code
  132. like the above will not significantly reduce your life expectancy, do
  133. not hesitate to use it. But if you use php/fi, you apparently are
  134. sure about that.</P>
  135.  
  136. </WEBPAGE>
  137.